<template>
  <div class="contentBox">
    <div class="leftView">
      <div>
        <div class="textAlignCenter marginBottom40">
          <img src="@/assets/logo/logo-title.png" alt="" width="215" height="42">
        </div>
        <h3 class="title">上海市注册会计师行业</h3>
        <h3 class="title">鉴证业务报告防伪系统</h3>
        <el-form ref="codeForm"
                 :model="codeForm"
                 :rules="codeRules"
                 :label-position="labelPosition"
                 class="login-form">
          <el-form-item prop="username" label="用户账号">
            <el-input
              v-model="codeForm.username"
              type="text"
              auto-complete="off"
              autofocus
              placeholder="请输入用户账号" />
          </el-form-item>
          <el-form-item style="width:100%;">
            <el-button
              size="medium"
              type="primary"
              style="width:100%;"
              @click.native.prevent="handleSubmit"
            >
              <span>确 定</span>
            </el-button>
          </el-form-item>
        </el-form>
      </div>
      </div>


  </div>
</template>

<script>
import JcRange from '@/components/SliderVerify'
import {removeKey} from "@/api/system/user";
export default {
  name: "CodeSearch",
  components: { JcRange },
  data() {
    let validateSlide = (rule, value, callback) => {
        let self = this;
        if (self.codeForm.slideStatus !== true) {
            callback(new Error('请向右滑动验证'));
        } else {
            callback();
        }
    };
    return {
      labelPosition: "top",
      codeForm: {
        username: '',
      },
      codeRules: {
        username: [
          { required: true, trigger: "blur", message: "请输入" }
        ],
      },
    };
  },
  created() {
  },
  methods: {
    handleSubmit() {
      this.$refs.codeForm.validate(valid => {
        if (valid) {
          let username = this.codeForm.username
          debugger
          removeKey(username).then(res=>{
            this.$message({
              type: 'success',
              message: '去除成功!'
            });
          });
          /*this.$confirm('确认去除'+row.userName+'的等待时间?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            let userName = row.userName
            removeKey(userName).then(res=>{
              this.$message({
                type: 'success',
                message: '去除成功!'
              });
            });
          }).catch(() => {
            this.$message({
              type: 'info',
              message: '去除已取消'
            });
          });*/
        }
      });
    },
  }
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.contentBox {
  height: 100%;
  background-image: url("../../assets/image/bg.png");
  background-size: cover;
}

.leftView{
  display: flex;
  justify-content: center;
  align-items: center;
  width: 500px;
  min-height: 100vh;
  background: #fff;
}
.title {
  margin: 0 auto 10px auto;
  font-size: 20px;
  text-align: center;
  color: #004B9E;
  font-weight: 400;
}

.login-form {
  margin: 80px auto 0 auto;
  width: 300px;
  border-radius: 6px;
  background: #ffffff;

  .el-input {
    height: 38px;
    input {
      height: 38px;
    }
  }
  .input-icon {
    height: 39px;
    width: 14px;
    margin-left: 2px;
  }
}
::v-deep .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before {
  content: '';  // 去掉 * 号
  color: #ff4949;
  margin-right: 4px;
}
::v-deep .el-button--primary {
  color: #fff;
  background-color: #4164E3;
  border-color: #4164E3;
}
</style>
